
// 我的歌单按钮
function openmenu(){
    document.getElementById("tabbar2").style.display="none";
    document.getElementById("list-img").className='list2-img';
    document.getElementById("tagboth").style.display="inherit";
    document.getElementById("mymusic").style.background="#000";
    document.getElementById("mymusic").style.color="#fff";
    document.getElementById("dexmusic").style.background="";
    document.getElementById("dexmusic").style.color="";
    document.getElementById("iframe").style.height="610";
    // console.log("333");
}

// 首页发现音乐按钮
function dex(){
    document.getElementById("tabbar2").style.display="block";
    document.getElementById("mymusic").style.background="";
    document.getElementById("mymusic").style.color="";
    document.getElementById("list-img").className="list1-img";
    document.getElementById("dexmusic").style.background="#000";
    document.getElementById("dexmusic").style.color="#fff";
    document.getElementById("tagboth").style.display="none";
    document.getElementById("iframe").style.height="2200";
}

// 首页LOGO按钮
function indexbtn(){
    var tab2=document.getElementById("tabbar2");
    // console.log(121);
    tab2.style.display="block";
    document.getElementById("dexmusic").style.background="#000";
    document.getElementById("list-img").className="list1-img";
    document.getElementById("dexmusic").style.color="#fff";
    document.getElementById("mymusic").style.background="";
    document.getElementById("mymusic").style.color="";
    document.getElementById("tagboth").style.display="none";
    document.getElementById("iframe").style.height="2200";
}

// 当网页向下滑动 20px 出现"返回顶部" 按钮
// window.onscroll = function() {scrollFunction()};
 
// window.onscroll=function scrollFunction() {
//     if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
//         document.getElementById("myBtn").style.display = "block";
//     } else {
//         document.getElementById("myBtn").style.display = "none";
//     }
// }

// 点击按钮，返回顶部
// function goTop(){
//     document.pageYOffset=0;
    // document.documentElement.scrollTop = 0;
// }


//使用addEvent添加scroll事件
document.addEventListener('scroll',function(){
    if(window.pageYOffset>=20){
        document.getElementById("myBtn").style.display="block";
    }else{
        document.getElementById("myBtn").style.display="none";
    }
})
 
//单击回到顶部
//直接使用单独的a标签书签链接
// function goTop(){
//     document.body.scrollTop=0;
// }